﻿//********************************************************************************//
//创建日期：<创建日期，2010-08-02>
//创建作者：<王一飞，wangyifei@shanghai3h.com>
//功能说明：WTB_GUOHUXX实体层次
//********************************************************************************//
#region Entity
namespace Entity
{
    using System;
    using System.Xml;
    [Serializable()]
    public class WTB_GUOHUXX
    {

        private int m_dec_id;
        /// <summary>
        /// ID自增长，禁止关联
        /// </summary>
        public int ID { get { return m_dec_id; } set { m_dec_id = value; } }

        private string m_str_s_zhubiaobh;
        /// <summary>
        /// 主表编号
        /// </summary>
        public string S_ZHUBIAOBH { get { return m_str_s_zhubiaobh; } set { m_str_s_zhubiaobh = value; } }

        private string m_str_incident_id;
        /// <summary>
        /// 申请单唯一ID
        /// </summary>
        public string INCIDENT_ID { get { return m_str_incident_id; } set { m_str_incident_id = value; } }

        private string m_str_new_entity_name;
        /// <summary>
        /// 新业主客户名称
        /// </summary>
        public string NEW_ENTITY_NAME { get { return m_str_new_entity_name; } set { m_str_new_entity_name = value; } }

        private string m_str_id_type;
        /// <summary>
        /// 新客户证件类型
        /// </summary>
        public string ID_TYPE { get { return m_str_id_type; } set { m_str_id_type = value; } }

        private string m_str_id_nbr;
        /// <summary>
        /// 新证件号码
        /// </summary>
        public string ID_NBR { get { return m_str_id_nbr; } set { m_str_id_nbr = value; } }

        private string m_str_fczjlx;
        /// <summary>
        /// 房产证件类型
        /// </summary>
        public string FCZJLX { get { return m_str_fczjlx; } set { m_str_fczjlx = value; } }

        private string m_str_fczjhm;
        /// <summary>
        /// 房产证件号码
        /// </summary>
        public string FCZJHM { get { return m_str_fczjhm; } set { m_str_fczjhm = value; } }

        private string m_str_address;
        /// <summary>
        /// 房产地址
        /// </summary>
        public string ADDRESS { get { return m_str_address; } set { m_str_address = value; } }

        private string m_str_comm_rte_type_cd;
        /// <summary>
        /// 人员联系类型
        /// </summary>
        public string COMM_RTE_TYPE_CD { get { return m_str_comm_rte_type_cd; } set { m_str_comm_rte_type_cd = value; } }

        private string m_str_contact_value;
        /// <summary>
        /// 电话号码
        /// </summary>
        public string CONTACT_VALUE { get { return m_str_contact_value; } set { m_str_contact_value = value; } }

        private string m_str_gyshtbh;
        /// <summary>
        /// 合同编号
        /// </summary>
        public string GYSHTBH { get { return m_str_gyshtbh; } set { m_str_gyshtbh = value; } }

        private string m_str_fplx;
        /// <summary>
        /// 发票类型
        /// </summary>
        public string FPLX { get { return m_str_fplx; } set { m_str_fplx = value; } }

        private string m_str_fptt;
        /// <summary>
        /// 发票抬头
        /// </summary>
        public string FPTT { get { return m_str_fptt; } set { m_str_fptt = value; } }

        private string m_str_nsrsbh;
        /// <summary>
        /// 统一社会信用代码
        /// </summary>
        public string NSRSBH { get { return m_str_nsrsbh; } set { m_str_nsrsbh = value; } }

        private string m_str_ysrks;
        /// <summary>
        /// 用水人口数
        /// </summary>
        public string YSRKS { get { return m_str_ysrks; } set { m_str_ysrks = value; } }

        private string m_str_transfer_comment;
        /// <summary>
        /// 备注
        /// </summary>
        public string TRANSFER_COMMENT { get { return m_str_transfer_comment; } set { m_str_transfer_comment = value; } }

        private string m_str_typc;
        /// <summary>
        /// 统一批次号(标记一个批次的过户操作)
        /// </summary>
        public string TYPC { get { return m_str_typc; } set { m_str_typc = value; } }

        private int? m_dec_i_beiyong1;
        /// <summary>
        /// 
        /// </summary>
        public int? I_BEIYONG1 { get { return m_dec_i_beiyong1; } set { m_dec_i_beiyong1 = value; } }

        private int? m_dec_i_beiyong2;
        /// <summary>
        /// 
        /// </summary>
        public int? I_BEIYONG2 { get { return m_dec_i_beiyong2; } set { m_dec_i_beiyong2 = value; } }

        private int? m_dec_i_beiyong3;
        /// <summary>
        /// 
        /// </summary>
        public int? I_BEIYONG3 { get { return m_dec_i_beiyong3; } set { m_dec_i_beiyong3 = value; } }

        private string m_str_s_beiyong1;
        /// <summary>
        /// 回填备注
        /// </summary>
        public string S_BEIYONG1 { get { return m_str_s_beiyong1; } set { m_str_s_beiyong1 = value; } }

        private string m_str_s_beiyong2;
        /// <summary>
        /// 填写"过户"或实名制。用于区分两种业务
        /// </summary>
        public string S_BEIYONG2 { get { return m_str_s_beiyong2; } set { m_str_s_beiyong2 = value; } }

        private string m_str_s_beiyong3;
        /// <summary>
        /// 
        /// </summary>
        public string S_BEIYONG3 { get { return m_str_s_beiyong3; } set { m_str_s_beiyong3 = value; } }

        private DateTime? m_DT_d_beiyong1;
        /// <summary>
        /// 
        /// </summary>
        public DateTime? D_BEIYONG1 { get { return m_DT_d_beiyong1; } set { m_DT_d_beiyong1 = value; } }

        private DateTime? m_DT_d_beiyong2;
        /// <summary>
        /// 
        /// </summary>
        public DateTime? D_BEIYONG2 { get { return m_DT_d_beiyong2; } set { m_DT_d_beiyong2 = value; } }

        private DateTime? m_DT_d_beiyong3;
        /// <summary>
        /// 
        /// </summary>
        public DateTime? D_BEIYONG3 { get { return m_DT_d_beiyong3; } set { m_DT_d_beiyong3 = value; } }

        private string m_str_fyly;
        /// <summary>
        /// 反映来源--实名制使用
        /// </summary>
        public string FYLY { get { return m_str_fyly; } set { m_str_fyly = value; } }

        private string m_str_fyxs;
        /// <summary>
        /// 反映形式--实名制使用
        /// </summary>
        public string FYXS { get { return m_str_fyxs; } set { m_str_fyxs = value; } }

        private string m_str_fyqm;
        /// <summary>
        /// 反映区名--实名制使用
        /// </summary>
        public string FYQM { get { return m_str_fyqm; } set { m_str_fyqm = value; } }

        private string m_str_entity_name;
        /// <summary>
        /// 客户名称--实名制使用
        /// </summary>
        public string ENTITY_NAME { get { return m_str_entity_name; } set { m_str_entity_name = value; } }

        private string m_str_realname_comment;
        /// <summary>
        /// 备注--实名制使用
        /// </summary>
        public string REALNAME_COMMENT { get { return m_str_realname_comment; } set { m_str_realname_comment = value; } }

        private string m_str_meter_number;
        /// <summary>
        /// 水表读数--实名制使用
        /// </summary>
        public string METER_NUMBER { get { return m_str_meter_number; } set { m_str_meter_number = value; } }

        private string m_str_transfer_reason;
        /// <summary>
        /// 变更原因
        /// </summary>
        public string TRANSFER_REASON { get { return m_str_transfer_reason; } set { m_str_transfer_reason = value; } }

        private string m_str_use_type;
        /// <summary>
        /// 客户类型(房产使用类型)
        /// </summary>
        public string USE_TYPE { get { return m_str_use_type; } set { m_str_use_type = value; } }

        private string m_str_contacts;
        /// <summary>
        /// 联系人
        /// </summary>
        public string CONTACTS { get { return m_str_contacts; } set { m_str_contacts = value; } }

        private string m_str_contact_num;
        /// <summary>
        /// 联系人电话
        /// </summary>
        public string CONTACT_NUM { get { return m_str_contact_num; } set { m_str_contact_num = value; } }
        public WTB_GUOHUXX()
        {
        }
    }
}
#endregion
#region EntityProcess
namespace Access.BLL
{
    using System;
    using System.Data;
    //using System.Data.OracleClient;
    using Entity;
    using System.Configuration;
    using System.Data.Common;
    using Platform.Data;
    using Oracle.DataAccess.Client;
    using Oracle.DataAccess.Types;
    using Oracle.DataAccess;
    public class WTB_GUOHUXXProcess
    {
        #region Field
        protected string conn;
        #endregion
        #region Construction
        public WTB_GUOHUXXProcess() { conn = Platform.Configuration.ConfigHelper.BusinessConnString; }
        #endregion
        #region public

        /// <summary>
        /// 根据WTB_GUOHUXX实体添加或者修改WTB_GUOHUXX信息
        /// </summary>
        public bool InsertOrUpdate(WTB_GUOHUXX WTB_GUOHUXX, OracleTransaction Transaction)
        {
            if (WTB_GUOHUXX.ID == 0)
            {
                InsertWTB_GUOHUXX(WTB_GUOHUXX, Transaction);
            }
            else
            {
                UpdateWTB_GUOHUXX(WTB_GUOHUXX, Transaction);
            }
            return WTB_GUOHUXX.ID == 0 ? false : true;
        }

        /// <summary>
        /// 根据WTB_GUOHUXX实体添加或修改WTB_GUOHUXX信息
        /// </summary>
        public bool InsertOrUpdate(WTB_GUOHUXX WTB_GUOHUXX)
        {
            return InsertOrUpdate(WTB_GUOHUXX, null);
        }



        /// <summary>
        /// 根据WTB_GUOHUXX主键删除WTB_GUOHUXX信息
        /// </summary>
        /// <param name="ID"></param>
        public bool DeleteWTB_GUOHUXX(int ID, OracleTransaction Transaction)
        {
            string spName = "CS_DelWTB_GUOHUXX";
            OracleParameter[] storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = ID;
            int result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery((OracleTransaction)Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }

        /// <summary>
        /// 根据WTB_GUOHUXX主键删除WTB_GUOHUXX信息
        /// </summary>
        /// <param name="ID"></param>
        public bool DeleteWTB_GUOHUXX(int ID)
        {
            return DeleteWTB_GUOHUXX(ID, null);
        }

        /// <summary>
        /// 根据条件删除WTB_GUOHUXX信息
        /// </summary>
        /// <param name="WhereClause">条件子句(Oracle语句)不带where</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>如果删除成功，返回true,否则返回fals</returns>
        public bool DeleteWTB_GUOHUXXesDynamic(string WhereClause, OracleTransaction Transaction)
        {
            string spName = "CS_DelWTB_GUOHUXXesDyn";
            OracleParameter[] storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = WhereClause;
            int result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery((OracleTransaction)Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }

        /// <summary>
        /// 根据条件删除WTB_GUOHUXX信息
        /// </summary>
        /// <param name="WhereClause">条件子句(Oracle语句)不带where</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>如果删除成功，返回true,否则返回fals</returns>
        public bool DeleteWTB_GUOHUXXesDynamic(string WhereClause)
        {
            return DeleteWTB_GUOHUXXesDynamic(WhereClause, null);
        }

        /// <summary>
        /// 根据WTB_GUOHUXX主键选择WTB_GUOHUXX信息
        /// </summary>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>WTB_GUOHUXX信息</returns>
        public WTB_GUOHUXX SelectWTB_GUOHUXX(int ID, OracleTransaction Transaction)
        {
            string spName = "CS_SelWTB_GUOHUXX";
            OracleParameter[] storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = ID;
            OracleDataReader rd;
            if (Transaction == null)
                rd = OracleHelper.ExecuteReader(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                rd = OracleHelper.ExecuteReader((OracleTransaction)Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (rd.Read())
            {
                WTB_GUOHUXX WTB_GUOHUXX = PopulateWTB_GUOHUXX(rd);
                rd.Close();
                return WTB_GUOHUXX;
            }
            else
                return null;
        }

        /// <summary>
        /// 根据WTB_GUOHUXX主键选择WTB_GUOHUXX信息
        /// </summary>
        /// <returns>WTB_GUOHUXX信息</returns>
        public WTB_GUOHUXX SelectWTB_GUOHUXX(int ID)
        {
            return SelectWTB_GUOHUXX(ID, null);
        }

        /// <summary>
        /// 选择所有WTB_GUOHUXX信息
        /// </summary>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>所有WTB_GUOHUXX信息</returns>
        public DataTable SelectWTB_GUOHUXXesAll(OracleTransaction Transaction)
        {
            string spName = "CS_SelWTB_GUOHUXXesAll";
            OracleParameter[] storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset((OracleTransaction)Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            else
                return null;
        }

        /// <summary>
        /// 选择所有WTB_GUOHUXX信息
        /// </summary>
        /// <returns>所有WTB_GUOHUXX信息</returns>
        public DataTable SelectWTB_GUOHUXXesAll()
        {
            return SelectWTB_GUOHUXXesAll(null);
        }

        /// <summary>
        /// 根据条件选择WTB_GUOHUXX信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>WTB_GUOHUXX信息</returns>
        public DataTable SelectWTB_GUOHUXXesDynamic(string WhereClause, string OrderByExpression, OracleTransaction Transaction)
        {
            string spName = "CS_SelWTB_GUOHUXXesDyn";
            OracleParameter[] storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = string.IsNullOrEmpty(WhereClause.Trim()) ? "1=1" : WhereClause;
            storedParams[1].Value = OrderByExpression;
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset((OracleTransaction)Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            else
                return null;
        }


        /// <summary>
        /// 根据条件选择WTB_GUOHUXX信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <returns>WTB_GUOHUXX信息</returns>
        public DataTable SelectWTB_GUOHUXXesDynamic(string WhereClause, string OrderByExpression)
        {
            return SelectWTB_GUOHUXXesDynamic(WhereClause, OrderByExpression, null);
        }



        /// <summary>
        /// 根据条件选择WTB_GUOHUXX信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="PageIndex">页码</param>
        /// <param name="PageSize">页数</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>WTB_GUOHUXX信息</returns>
        public DataTable SelectWTB_GUOHUXXesDynamic(string WhereClause, string OrderByExpression, int PageIndex, int PageSize, OracleTransaction Transaction)
        {
            string spName = "CS_SelWTB_GUOHUXXesDynPaged";
            OracleParameter[] storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = string.IsNullOrEmpty(WhereClause.Trim()) ? "1=1" : WhereClause;
            storedParams[1].Value = OrderByExpression;
            storedParams[2].Value = PageIndex;
            storedParams[3].Value = PageSize;
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset((OracleTransaction)Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            else
                return null;
        }


        /// <summary>
        /// 根据条件选择WTB_GUOHUXX信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="PageIndex">页码</param>
        /// <param name="PageSize">页数</param>
        /// <returns>WTB_GUOHUXX信息</returns>
        public DataTable SelectWTB_GUOHUXXesDynamic(string WhereClause, string OrderByExpression, int PageIndex, int PageSize)
        {
            return SelectWTB_GUOHUXXesDynamic(WhereClause, OrderByExpression, PageIndex, PageSize, null);
        }

        /// <summary>
        ///根据条件更新WTB_GUOHUXX字段
        /// </summary>
        /// <returns>受影响行数</returns>
        public int UpdateWTB_GUOHUXXesDynamic(string UpdateValue, string WhereClause, OracleTransaction Transaction)
        {
            int result = 0;
            if (UpdateValue == "" || WhereClause == "")
            {
                return 0;
            }
            string spName = "CS_UpdWTB_GUOHUXXDyn";
            OracleParameter[] storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            DataSet ds = null;
            storedParams[0].Value = UpdateValue;
            storedParams[1].Value = WhereClause;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset((OracleTransaction)Transaction, CommandType.StoredProcedure, spName, storedParams);
            result = Convert.ToInt32(storedParams[2].Value);
            return result;
        }

        /// <summary>
        ///根据条件更新WTB_GUOHUXX字段
        /// </summary>
        /// <returns>受影响行数</returns>
        public int UpdateWTB_GUOHUXXesDynamic(string UpdateValue, string WhereClause)
        {
            return UpdateWTB_GUOHUXXesDynamic(UpdateValue, WhereClause, null);
        }


        #endregion
        #region Private

        private int InsertWTB_GUOHUXX(WTB_GUOHUXX WTB_GUOHUXX, OracleTransaction Transaction)
        {
            string spName = "CS_InsWTB_GUOHUXX";
            OracleParameter[] storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = WTB_GUOHUXX.S_ZHUBIAOBH;
            storedParams[1].Value = WTB_GUOHUXX.INCIDENT_ID;
            storedParams[2].Value = WTB_GUOHUXX.NEW_ENTITY_NAME;
            storedParams[3].Value = WTB_GUOHUXX.ID_TYPE;
            storedParams[4].Value = WTB_GUOHUXX.ID_NBR;
            storedParams[5].Value = WTB_GUOHUXX.FCZJLX;
            storedParams[6].Value = WTB_GUOHUXX.FCZJHM;
            storedParams[7].Value = WTB_GUOHUXX.ADDRESS;
            storedParams[8].Value = WTB_GUOHUXX.COMM_RTE_TYPE_CD;
            storedParams[9].Value = WTB_GUOHUXX.CONTACT_VALUE;
            storedParams[10].Value = WTB_GUOHUXX.GYSHTBH;
            storedParams[11].Value = WTB_GUOHUXX.FPLX;
            storedParams[12].Value = WTB_GUOHUXX.FPTT;
            storedParams[13].Value = WTB_GUOHUXX.NSRSBH;
            storedParams[14].Value = WTB_GUOHUXX.YSRKS;
            storedParams[15].Value = WTB_GUOHUXX.TRANSFER_COMMENT;
            storedParams[16].Value = WTB_GUOHUXX.TYPC;
            storedParams[17].Value = WTB_GUOHUXX.I_BEIYONG1;
            storedParams[18].Value = WTB_GUOHUXX.I_BEIYONG2;
            storedParams[19].Value = WTB_GUOHUXX.I_BEIYONG3;
            storedParams[20].Value = WTB_GUOHUXX.S_BEIYONG1;
            storedParams[21].Value = WTB_GUOHUXX.S_BEIYONG2;
            storedParams[22].Value = WTB_GUOHUXX.S_BEIYONG3;
            storedParams[23].Value = WTB_GUOHUXX.D_BEIYONG1;
            storedParams[24].Value = WTB_GUOHUXX.D_BEIYONG2;
            storedParams[25].Value = WTB_GUOHUXX.D_BEIYONG3;
            storedParams[26].Value = WTB_GUOHUXX.FYLY;
            storedParams[27].Value = WTB_GUOHUXX.FYXS;
            storedParams[28].Value = WTB_GUOHUXX.FYQM;
            storedParams[29].Value = WTB_GUOHUXX.ENTITY_NAME;
            storedParams[30].Value = WTB_GUOHUXX.REALNAME_COMMENT;
            storedParams[31].Value = WTB_GUOHUXX.METER_NUMBER;
            storedParams[32].Value = WTB_GUOHUXX.TRANSFER_REASON;
            storedParams[33].Value = WTB_GUOHUXX.USE_TYPE;
            storedParams[34].Value = WTB_GUOHUXX.CONTACTS;
            storedParams[35].Value = WTB_GUOHUXX.CONTACT_NUM;
            int result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery((OracleTransaction)Transaction, CommandType.StoredProcedure, spName, storedParams);
            WTB_GUOHUXX.ID = Convert.ToInt32(storedParams[36].Value);
            return result;
        }
        private bool UpdateWTB_GUOHUXX(WTB_GUOHUXX WTB_GUOHUXX, OracleTransaction Transaction)
        {
            string spName = "CS_UpdWTB_GUOHUXX";
            OracleParameter[] storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = WTB_GUOHUXX.S_ZHUBIAOBH;
            storedParams[1].Value = WTB_GUOHUXX.INCIDENT_ID;
            storedParams[2].Value = WTB_GUOHUXX.NEW_ENTITY_NAME;
            storedParams[3].Value = WTB_GUOHUXX.ID_TYPE;
            storedParams[4].Value = WTB_GUOHUXX.ID_NBR;
            storedParams[5].Value = WTB_GUOHUXX.FCZJLX;
            storedParams[6].Value = WTB_GUOHUXX.FCZJHM;
            storedParams[7].Value = WTB_GUOHUXX.ADDRESS;
            storedParams[8].Value = WTB_GUOHUXX.COMM_RTE_TYPE_CD;
            storedParams[9].Value = WTB_GUOHUXX.CONTACT_VALUE;
            storedParams[10].Value = WTB_GUOHUXX.GYSHTBH;
            storedParams[11].Value = WTB_GUOHUXX.FPLX;
            storedParams[12].Value = WTB_GUOHUXX.FPTT;
            storedParams[13].Value = WTB_GUOHUXX.NSRSBH;
            storedParams[14].Value = WTB_GUOHUXX.YSRKS;
            storedParams[15].Value = WTB_GUOHUXX.TRANSFER_COMMENT;
            storedParams[16].Value = WTB_GUOHUXX.TYPC;
            storedParams[17].Value = WTB_GUOHUXX.I_BEIYONG1;
            storedParams[18].Value = WTB_GUOHUXX.I_BEIYONG2;
            storedParams[19].Value = WTB_GUOHUXX.I_BEIYONG3;
            storedParams[20].Value = WTB_GUOHUXX.S_BEIYONG1;
            storedParams[21].Value = WTB_GUOHUXX.S_BEIYONG2;
            storedParams[22].Value = WTB_GUOHUXX.S_BEIYONG3;
            storedParams[23].Value = WTB_GUOHUXX.D_BEIYONG1;
            storedParams[24].Value = WTB_GUOHUXX.D_BEIYONG2;
            storedParams[25].Value = WTB_GUOHUXX.D_BEIYONG3;
            storedParams[26].Value = WTB_GUOHUXX.FYLY;
            storedParams[27].Value = WTB_GUOHUXX.FYXS;
            storedParams[28].Value = WTB_GUOHUXX.FYQM;
            storedParams[29].Value = WTB_GUOHUXX.ENTITY_NAME;
            storedParams[30].Value = WTB_GUOHUXX.REALNAME_COMMENT;
            storedParams[31].Value = WTB_GUOHUXX.METER_NUMBER;
            storedParams[32].Value = WTB_GUOHUXX.TRANSFER_REASON;
            storedParams[33].Value = WTB_GUOHUXX.USE_TYPE;
            storedParams[34].Value = WTB_GUOHUXX.CONTACTS;
            storedParams[35].Value = WTB_GUOHUXX.CONTACT_NUM;
            storedParams[36].Value = WTB_GUOHUXX.ID;
            int result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery((OracleTransaction)Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }


        private WTB_GUOHUXX PopulateWTB_GUOHUXX(IDataReader dr)
        {
            WTB_GUOHUXX WTB_GUOHUXX = new WTB_GUOHUXX();
            WTB_GUOHUXX.ID = dr["ID"] == DBNull.Value ? (int)0 : (int)dr["ID"];
            WTB_GUOHUXX.S_ZHUBIAOBH = dr["S_ZHUBIAOBH"] == DBNull.Value ? null : (string)dr["S_ZHUBIAOBH"];
            WTB_GUOHUXX.INCIDENT_ID = dr["INCIDENT_ID"] == DBNull.Value ? null : (string)dr["INCIDENT_ID"];
            WTB_GUOHUXX.NEW_ENTITY_NAME = dr["NEW_ENTITY_NAME"] == DBNull.Value ? null : (string)dr["NEW_ENTITY_NAME"];
            WTB_GUOHUXX.ID_TYPE = dr["ID_TYPE"] == DBNull.Value ? null : (string)dr["ID_TYPE"];
            WTB_GUOHUXX.ID_NBR = dr["ID_NBR"] == DBNull.Value ? null : (string)dr["ID_NBR"];
            WTB_GUOHUXX.FCZJLX = dr["FCZJLX"] == DBNull.Value ? null : (string)dr["FCZJLX"];
            WTB_GUOHUXX.FCZJHM = dr["FCZJHM"] == DBNull.Value ? null : (string)dr["FCZJHM"];
            WTB_GUOHUXX.ADDRESS = dr["ADDRESS"] == DBNull.Value ? null : (string)dr["ADDRESS"];
            WTB_GUOHUXX.COMM_RTE_TYPE_CD = dr["COMM_RTE_TYPE_CD"] == DBNull.Value ? null : (string)dr["COMM_RTE_TYPE_CD"];
            WTB_GUOHUXX.CONTACT_VALUE = dr["CONTACT_VALUE"] == DBNull.Value ? null : (string)dr["CONTACT_VALUE"];
            WTB_GUOHUXX.GYSHTBH = dr["GYSHTBH"] == DBNull.Value ? null : (string)dr["GYSHTBH"];
            WTB_GUOHUXX.FPLX = dr["FPLX"] == DBNull.Value ? null : (string)dr["FPLX"];
            WTB_GUOHUXX.FPTT = dr["FPTT"] == DBNull.Value ? null : (string)dr["FPTT"];
            WTB_GUOHUXX.NSRSBH = dr["NSRSBH"] == DBNull.Value ? null : (string)dr["NSRSBH"];
            WTB_GUOHUXX.YSRKS = dr["YSRKS"] == DBNull.Value ? null : (string)dr["YSRKS"];
            WTB_GUOHUXX.TRANSFER_COMMENT = dr["TRANSFER_COMMENT"] == DBNull.Value ? null : (string)dr["TRANSFER_COMMENT"];
            WTB_GUOHUXX.TYPC = dr["TYPC"] == DBNull.Value ? null : (string)dr["TYPC"];
            WTB_GUOHUXX.I_BEIYONG1 = dr["I_BEIYONG1"] == DBNull.Value ? null : (int?)dr["I_BEIYONG1"];
            WTB_GUOHUXX.I_BEIYONG2 = dr["I_BEIYONG2"] == DBNull.Value ? null : (int?)dr["I_BEIYONG2"];
            WTB_GUOHUXX.I_BEIYONG3 = dr["I_BEIYONG3"] == DBNull.Value ? null : (int?)dr["I_BEIYONG3"];
            WTB_GUOHUXX.S_BEIYONG1 = dr["S_BEIYONG1"] == DBNull.Value ? null : (string)dr["S_BEIYONG1"];
            WTB_GUOHUXX.S_BEIYONG2 = dr["S_BEIYONG2"] == DBNull.Value ? null : (string)dr["S_BEIYONG2"];
            WTB_GUOHUXX.S_BEIYONG3 = dr["S_BEIYONG3"] == DBNull.Value ? null : (string)dr["S_BEIYONG3"];
            WTB_GUOHUXX.D_BEIYONG1 = dr["D_BEIYONG1"] == DBNull.Value ? null : (DateTime?)dr["D_BEIYONG1"];
            WTB_GUOHUXX.D_BEIYONG2 = dr["D_BEIYONG2"] == DBNull.Value ? null : (DateTime?)dr["D_BEIYONG2"];
            WTB_GUOHUXX.D_BEIYONG3 = dr["D_BEIYONG3"] == DBNull.Value ? null : (DateTime?)dr["D_BEIYONG3"];
            WTB_GUOHUXX.FYLY = dr["FYLY"] == DBNull.Value ? null : (string)dr["FYLY"];
            WTB_GUOHUXX.FYXS = dr["FYXS"] == DBNull.Value ? null : (string)dr["FYXS"];
            WTB_GUOHUXX.FYQM = dr["FYQM"] == DBNull.Value ? null : (string)dr["FYQM"];
            WTB_GUOHUXX.ENTITY_NAME = dr["ENTITY_NAME"] == DBNull.Value ? null : (string)dr["ENTITY_NAME"];
            WTB_GUOHUXX.REALNAME_COMMENT = dr["REALNAME_COMMENT"] == DBNull.Value ? null : (string)dr["REALNAME_COMMENT"];
            WTB_GUOHUXX.METER_NUMBER = dr["METER_NUMBER"] == DBNull.Value ? null : (string)dr["METER_NUMBER"];
            WTB_GUOHUXX.TRANSFER_REASON = dr["TRANSFER_REASON"] == DBNull.Value ? null : (string)dr["TRANSFER_REASON"];
            WTB_GUOHUXX.USE_TYPE = dr["USE_TYPE"] == DBNull.Value ? null : (string)dr["USE_TYPE"];
            WTB_GUOHUXX.CONTACTS = dr["CONTACTS"] == DBNull.Value ? null : (string)dr["CONTACTS"];
            WTB_GUOHUXX.CONTACT_NUM = dr["CONTACT_NUM"] == DBNull.Value ? null : (string)dr["CONTACT_NUM"];
            return WTB_GUOHUXX;
        }


        private void AddRowNumber(DataTable dt)
        {
            dt.Columns.Add(new DataColumn("RowNumber", typeof(int)));
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                dt.Rows[i][dt.Columns.Count - 1] = i + 1;
            }
        }
        #endregion
    }
}
#endregion